import 'package:auto_route/auto_route.dart';
import 'package:tender_flutter/manager/login_manager.dart';
import 'package:tender_flutter/manager/permission_manager.dart';

/// 登录检验处理
class LoginGuard extends RouteGuard {
  @override
  Future<bool> canNavigate(ExtendedNavigatorState navigator, String routeName,
      Object arguments) async {
    var result = PermissionManager.isLogin();
    if (!result) {
      LoginManager.login();
    }
    return result;
  }
}
